//
//  uploadImage.m
//  Kids
//
//  Created by LiTengFei on 14/12/14.
//  Copyright (c) 2014年 90's Technology Co.Ltd. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import "WatchAddRequestData.h"
#import "WatchAddResponseData.h"
#import "NSString+md5.h"
#import "RequestFactory.h"
@interface uploadImage : XCTestCase

@end

@implementation uploadImage

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample {
     XCTestExpectation * exception = [self expectationWithDescription:@"High Expectations"];
    WatchAddRequestData * requestData= [[WatchAddRequestData alloc]init];
    requestData.imei = @"30068000203559";
    requestData.pphone = @"15867170461";
    requestData.ppassword = [@"123" md5];
    requestData.wphone = @"123123312";
    requestData.name = @"111";
    
    
//    UIImage * im = [UIImage imageNamed:];
//    NSData * data = UIImageJPEGRepresentation(im, 1.0);
//    NSString * base64 = [data base64EncodedStringWithOptions:0];
    requestData.image = @"111111111";
    
    WatchAddResponseData * response = [[WatchAddResponseData alloc]init];
    
    [RequestFactory requestWithRequestData:requestData forResponseData:response complete:^(ResponseData *responseData, NSError *error) {
        if(responseData){
            NSLog(@"%@",responseData.info);
            [exception fulfill];

        }
    }];
    
    [self waitForExpectationsWithTimeout:10.0 handler:^(NSError* error) {
        if(error){
            NSLog(@"TImeout Error : %@",error);
        }
    }];


}

- (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
        // Put the code you want to measure the time of here.
    }];
}

@end
